package org.salatec.tapestry4e.util;

import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;

/**
 * Several utilities to help finding packages and classpath in projects.
 * 
 * @author Juan M. Salamanca
 * 
 *         16/03/2009
 */
public class ClasspathUtils {

	/**
	 * @param selectedJavaFile
	 * @return
	 */
	public static IPath getTemplateFilePath(IResource selectedJavaFile) {
		String path = selectedJavaFile.getParent().getProjectRelativePath()
				.toPortableString();
		path = path.replaceAll("src/main/java", "src/main/resources");
		return new Path(path);
	}

}
